package main

import (
    "fmt"
    "os"
    "log"
    "path/filepath"
    // "strings"
    // "github.com/neovim/go-client/nvim/plugin"
)

var s string   //全局变量
func hello(args []string) (string, error) {
    // 遍历打印所有的文件名
    filepath.Walk("~/Documents/delete", walkFunc)
    return s, nil
}

func walkFunc(path string, info os.FileInfo, err error) error {
    s += fmt.Sprintf("%s\n", path)
    return nil
}

func main() {
    files, err := filepath.Glob("*")
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(files) // contains a list of all files in the current directory
    // plugin.Main(func(p *plugin.Plugin) error {
    //     p.HandleFunction(&plugin.FunctionOptions{Name: "Hello"}, hello)
    //         return nil
    // })
}
